//
//  IFlyIVWService.h
//  AIKITDemo
//
//  Created by xyzhang on 2023/3/8.
//

/* IVW 异步流式
 * https://www.iflyaicloud.com/web/aee/v1/ability/docHtml?serviceId=e867a88f2
 */

#import "IFlyBaseService.h"
#import "IFlyIVWConfig.h"
#import "IFlyVoiceWakeupDelegate.h"

NS_ASSUME_NONNULL_BEGIN

@interface IFlyIVWService : IFlyBaseService

@property (nonatomic, weak) id<IFlyVoiceWakeupDelegate> delegate;

/// 能力id
@property (nonatomic, copy, readonly) NSString *abilityId;

@property (nonatomic, strong) IFlyIVWConfig *config;

/// 正在唤醒
@property (nonatomic, assign, readonly) BOOL isListening;

//@property (nonatomic, strong) NSString *format; // 音频格式 默认pcm
//@property (nonatomic, strong) NSString *outPath; // 音频保存路径
//@property (nonatomic, strong, nullable) NSMutableData *audioData;

+ (instancetype)shareInstance;

- (BOOL)startListening;

- (BOOL)stopListening;

- (BOOL)cancel;

/// 写入音频流
/// - Parameter audioData: 音频数据
- (BOOL)writeAudio:(NSData *)audioData;

@end

NS_ASSUME_NONNULL_END
